package com.crm.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateEx {

	private static SimpleDateFormat formatCommon = new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss秒");
	private static SimpleDateFormat formatLong = new SimpleDateFormat("yyyyMMddHHmmss");
	private static SimpleDateFormat formatDateLong = new SimpleDateFormat("yyyyMMdd");
	private static SimpleDateFormat formatTimeLong = new SimpleDateFormat("HHmmss");
	
	public static Long getCurDatetimeAsLong(){
		Date date = new Date();
		return Long.parseLong(formatLong.format(date));
	}
	
	public static Long getCurDateAsLong(){
		Date date = new Date();
		return Long.parseLong(formatDateLong.format(date));
	}
	
	public static Long getCurTimeAsLong(){
		Date date = new Date();
		return Long.parseLong(formatTimeLong.format(date));
	}
	
	public static String getCurDateTime(){
		return formatCommon.format(new Date());
	}
	
	public static void main(String[] args) {		
		System.out.println(getCurDatetimeAsLong());
	}

}
